Skip to content

Proposal: Arm64 Support and Multi-Architecture Image Publishing for Harbor #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ranimandepudi
Copy link

@ranimandepudi ranimandepudi commented May 8, 2025

Tested and confirmed: Harbor functions fully on both Arm64 and Amd64 platforms, including the UI, API, registry, and multi-architecture artifact handling.

As the author of this contribution from Arm, I welcome any feedback, collaboration, or questions from the Harbor community.

Thank you to the community for your continued support. Arm ambassadors are always ready to support Harbor.

Related PR in the main Harbor repository: goharbor/harbor#21982

@stonezdj
Copy link
Contributor

stonezdj commented May 12, 2025

@ranimandepudi bitnami has already built arm images for Harbor, it is open-sourced in https://github.com/bitnami/containers/tree/main/bitnami, and images is available in https://hub.docker.com/r/bitnami/harbor-core, maybe you could reference it.

@ranimandepudi
Copy link
Author

@ranimandepudi bitnami has already built arm images for Harbor, it is open-sourced in https://github.com/bitnami/containers/tree/main/bitnami, and images is available in https://hub.docker.com/r/bitnami/harbor-core, maybe you could reference it.

Thanks for sharing this @stonezdj !

Just to clarify — the changes I proposed in the PR are focused solely on enabling multi-arch Docker image builds without impacting existing functionality. Since Photon OS already supports both amd64 and arm64, my patch preserves the current behavior while adding support for Arm builds in a clean and upstream-friendly way.

@wy65701436 wy65701436 self-assigned this May 12, 2025
@OrlinVasilev
Copy link
Member

@ranimandepudi can you link the PR in the main repository for the changes!
I find it super useful if we as a project can provide our arm64 arch images! +1

@OrlinVasilev
Copy link
Member

@ranimandepudi can you please fix your DCO

@OrlinVasilev OrlinVasilev self-assigned this May 12, 2025
Copy link
Member

@OrlinVasilev OrlinVasilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a MUST have!

@ranimandepudi ranimandepudi force-pushed the my-new-proposal-arm64 branch from 14aec1f to 6e1fe36 Compare May 12, 2025 16:55
Signed-off-by: Rani Chowdary Mandepudi <[email protected]>
@ranimandepudi ranimandepudi force-pushed the my-new-proposal-arm64 branch from 6e1fe36 to a044855 Compare May 12, 2025 16:56
@ranimandepudi
Copy link
Author

@OrlinVasilev Thank you for your support! I have made the updates based on your comments. Please let me know if any further changes are needed.


## Testing

To validate that our custom-built Harbor instance with ARM64 support works correctly across components and architectures, I performed the following levels of testing:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be automatically done in the CI.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I will update it but just added it is also manually tested !!

ranichowdary/jobservice-harbor
ranichowdary/jobservice-base-harbor
Registry:
ranichowdary/registry-harbor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me use the registry build as an example to illustrate the idea. We currently have two Dockerfiles involved in the process—one for building the binary and another for creating the final image.

From my understanding, the first step should be updating the Dockerfile.binary and its corresponding builder scripts to support specifying GOARCH when compiling the registry binary. Once that's in place, we can evaluate whether changes to the second Dockerfile (used for building the final image) are also needed.

RUN CGO_ENABLED=0 GOARCH=$TARGETARCH make PREFIX=/go clean binaries

I believe it's important to include sufficient technical detail here, rather than keeping it high-level. This will help the maintainers better assess whether the proposal is technically sound and practically feasible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wy65701436 While our CI now builds on native amd64 and arm64 runners via a matrix strategy (so cross-compilation isn't strictly required), would you still recommend explicitly adding GOARCH=$TARGETARCH in Dockerfile.binary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have some discussion around this part, as the parameter needs to be passed down from the top-level make call to the lower levels.

A few questions to consider:
How should we structure the code?
Will we maintain separate builders and Dockerfiles for each architecture, or consolidate them into one?

From an engineering perspective, I’d prefer to separate the code paths initially — one for x86 and one for ARM — and merge them later once the ARM path is stable and production-ready. While this approach introduces some code duplication, it ensures that our current stable releases remain unaffected.

@OrlinVasilev OrlinVasilev requested a review from Vad1mo May 14, 2025 07:07

These changes allow Harbor to be built, packaged, and installed cleanly on Arm64 hosts such as AWS Graviton and also on x86 as images are multi arch.

This proposal introduces native Arm64 builds for Harbor components using `Docker Build` and multi-architecture manifests. Each image is tested and published in a way that maintains compatibility with existing Amd64-based deployments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Harbor has already released both offline and online installers to the community, does this proposal also cover the release of Harbor ARM installers (both offline and online)?

I bring this up because if we decide to release the ARM installer, we should also consider the prepare image, as it plays a critical role in the installation process. If this proposal does not cover that scope, please add a section to clarify what is and isn’t included.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will update it and commit !!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide an update on this? I believe we should support both the online and offline installers, at least in Phase 2. Otherwise, it seems we would only be providing the Harbor Helm chart on ARM — is that aligned with your thinking?


## Build and Push Workflow (Per Architecture)

Each image is built and pushed in the following steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the entrypoint perspective, will we add a flag to the Makefile to specify the target platform architecture for building images? I assume we should include such a flag, with x86_64 as the default, and allow it to be extended to support arm as well.

@ranimandepudi ranimandepudi force-pushed the my-new-proposal-arm64 branch from 65692f9 to 204bad3 Compare May 20, 2025 16:37
@ranimandepudi
Copy link
Author

@wy65701436 — Could you please review it and let me know if anything needs to be updated ?
Also, you can check this PR: https://github.com/goharbor/harbor/pull/21982/files
which doesn’t have a CI pipeline. However, if you pull the PR and test it — since there are no functional changes — it should work fine on both Arm and Amd instances.

I have the CI pipeline changes in my local, can push them once this is tested !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants